#ifndef _CRT_TPID_HPP_
#define _CRT_TPID_HPP_

#include <crt_core.hpp>

#define OS_THREAD_BUSY	100
#define OS_THREAD_ERROR 1
#define OS_THREAD_SUC	0

#if (TARGET_OS == OS_WINDOWS)
	#define INSNULL				NULL
    typedef int                 _pid_t;
	typedef HINSTANCE			_pinstance;
    typedef HANDLE              _thread_t;
	typedef DWORD				_thread_id;
	typedef HANDLE              _pipe_t;
#elif (TARGET_OS == OS_POSIX)
	#define INSNULL				0
    typedef pid_t               _pid_t;
	typedef pid_t				_pinstance;
    typedef pthread_t           _thread_t;
	typedef DWORD				_thread_id;
	typedef int              	_pipe_t;
	#define INVALID_HANDLE_VALUE     0 
	#include <pthread.h>
#elif (TARGET_OS == OS_DARWIN)
	#define INSNULL				0
    typedef pid_t               _pid_t;
    typedef pid_t               _pinstance;
    typedef pthread_t           _thread_t;
	typedef DWORD				_thread_id;
	typedef int              	_pipe_t;
	#define INVALID_HANDLE_VALUE     0 
	#include <pthread.h>
#endif

#endif 
